{"ast":null,"code":"var _s = $RefreshSig$();\nimport React from \"react\";\nimport { Context } from \"../index\";\nimport { observer } from \"mobx-react-lite\";\nimport { Fragment as _Fragment } from \"react/jsx-dev-runtime\";\nimport { jsxDEV as _jsxDEV } from \"react/jsx-dev-runtime\";\nconst Contacts = () => {\n  _s();\n  const {\n    store\n  } = React.useContext(Context);\n  const [contacts, setContacts] = React.useState({\n    items: []\n  });\n  const [sort, setSort] = React.useState({\n    items: []\n  });\n  const [flag, setFlag] = React.useState(false);\n  React.useEffect(() => {\n    if (!flag && store.getChats().items === undefined) {\n      store.getChatsFromAPI().then();\n    } else {\n      setFlag(true);\n    }\n    setSort({\n      ...sort,\n      items: []\n    });\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, []);\n  React.useEffect(() => {\n    setContacts({\n      ...contacts,\n      ...store.getContacts()\n    });\n    console.log(store.getContacts());\n    // eslint-disable-next-line react-hooks/exhaustive-deps\n  }, [store.contacts]);\n  contacts.items.forEach((item, index) => {});\n  return /*#__PURE__*/_jsxDEV(_Fragment, {}, void 0, false);\n};\n_s(Contacts, \"sAj3I2E4OovYsfh13ecJ+VMPtwU=\");\n_c = Contacts;\nexport default _c2 = observer(Contacts);\nvar _c, _c2;\n$RefreshReg$(_c, \"Contacts\");\n$RefreshReg$(_c2, \"%default%\");","map":{"version":3,"names":["React","Context","observer","Contacts","store","useContext","contacts","setContacts","useState","items","sort","setSort","flag","setFlag","useEffect","getChats","undefined","getChatsFromAPI","then","getContacts","console","log","forEach","item","index"],"sources":["/data/messenger.client/src/containers/Contacts.tsx"],"sourcesContent":["import React from \"react\";\nimport {Contacts as ContactsList} from \"../components/\";\nimport {Context} from \"../index\";\nimport {observer} from \"mobx-react-lite\";\nimport {ContactListResponse} from \"../models/response/ContactListResponse\";\n\nconst Contacts:React.FC = () => {\n    const {store} = React.useContext(Context);\n    const [contacts, setContacts] = React.useState<ContactListResponse>({items: []});\n    const [sort, setSort] = React.useState<ContactListResponse>({items: []});\n    const [flag, setFlag] = React.useState<boolean>(false);\n\n    React.useEffect(() => {\n        if (!flag && store.getChats().items === undefined) {\n            store.getChatsFromAPI().then();\n        } else {\n            setFlag(true);\n        }\n        setSort({\n            ...sort,\n            items: []\n        });\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, []);\n\n    React.useEffect(() => {\n        setContacts({\n            ...contacts,\n            ...store.getContacts()\n        });\n\n        console.log(store.getContacts())\n        // eslint-disable-next-line react-hooks/exhaustive-deps\n    }, [store.contacts]);\n\n    contacts.items.forEach((item, index) => {\n\n    });\n\n    return (<></>);\n\n};\n\nexport default observer(Contacts);"],"mappings":";AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAAQC,OAAO,QAAO,UAAU;AAChC,SAAQC,QAAQ,QAAO,iBAAiB;AAAC;AAAA;AAGzC,MAAMC,QAAiB,GAAG,MAAM;EAAA;EAC5B,MAAM;IAACC;EAAK,CAAC,GAAGJ,KAAK,CAACK,UAAU,CAACJ,OAAO,CAAC;EACzC,MAAM,CAACK,QAAQ,EAAEC,WAAW,CAAC,GAAGP,KAAK,CAACQ,QAAQ,CAAsB;IAACC,KAAK,EAAE;EAAE,CAAC,CAAC;EAChF,MAAM,CAACC,IAAI,EAAEC,OAAO,CAAC,GAAGX,KAAK,CAACQ,QAAQ,CAAsB;IAACC,KAAK,EAAE;EAAE,CAAC,CAAC;EACxE,MAAM,CAACG,IAAI,EAAEC,OAAO,CAAC,GAAGb,KAAK,CAACQ,QAAQ,CAAU,KAAK,CAAC;EAEtDR,KAAK,CAACc,SAAS,CAAC,MAAM;IAClB,IAAI,CAACF,IAAI,IAAIR,KAAK,CAACW,QAAQ,EAAE,CAACN,KAAK,KAAKO,SAAS,EAAE;MAC/CZ,KAAK,CAACa,eAAe,EAAE,CAACC,IAAI,EAAE;IAClC,CAAC,MAAM;MACHL,OAAO,CAAC,IAAI,CAAC;IACjB;IACAF,OAAO,CAAC;MACJ,GAAGD,IAAI;MACPD,KAAK,EAAE;IACX,CA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